package net.dipper.tankwar.editor.ui;

import java.awt.BorderLayout;

import javax.swing.JComponent;
import javax.swing.JFrame;

public class MainWindow extends JFrame {
	/**
	 * 
	 */
	public final int DEFAULT_WIDTH = 1024;
	public final int DEFAULT_HEIGHT = 600;
	
	private static final long serialVersionUID = 1L;
	private JComponent currentPane;

	public MainWindow(String title){
		super(title);
		
		setLayout(new BorderLayout());
		setBounds(0, 0, DEFAULT_WIDTH, DEFAULT_HEIGHT);
	}

	public void setPane(EditorPane pane) {
		if(currentPane != null){
			remove(currentPane);
		}
		
		add(pane, BorderLayout.CENTER);
		currentPane = pane;
	}
}
